import { createRouter, createWebHistory } from 'vue-router'


export const menu_children = [
  {
    path: '/',
    meta: {
      title: '首页'
    },
    component: () =>import('@/views/home/indexView.vue')
  },
  {
    path: '/set',
    meta: {
      title: '设置'
    },
    component: ()=> import('@/views/set/indexView.vue')
  },
  {
    path: '/list',
    meta: {
      title: '列表管理'
    },
    children: [
      {
        path: '/list/add',
        meta: {
          title: '新增列表'
        },
        component: () => import('@/views/listAdd/indexView.vue')
      },
      {
        path: '/list/mange',
        meta: {
          title: '设置列表'
        },
        component: () => import('@/views/list/indexView.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: () => import('@/views/layout/indexView.vue'),
      children: menu_children
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('@/views/about/indexView.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/indexView.vue')
    },
  ]
})

export default router
